﻿using FastSocket.Client.Protocol;
using FastSocket.SocketBase;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SocketTool.Com.TCP.Client
{
    public class TCPClientProtocol : IProtocol<TCPClientMessage>
    {
        public bool IsAsync => true;

        public int DefaultSyncSeqID => 1;

        public CustomerProtocol Protocols { get; set; }

        public TCPClientMessage Parse(IConnection connection, ArraySegment<byte> buffer, out int readlength)
        {
            var bt = this.Protocols.Parse(buffer, out readlength);
            return new TCPClientMessage(1, bt);
        }
    }
}
